package edu.sctu.zhengsenwen.month201506.day20150619.Practice;

import javax.swing.*;

/**
 * Created by user15 on 2015/6/19.
 */
public abstract class AbstractAnimal implements InterfaceSpeak{


    private String name;
    private String eyeColor;
    private String sound;
    private int age;

    public String getName() {
        return name;
    }

    public String getEyeColor() {
        return eyeColor;
    }

    public String getSound() {
        return sound;
    }

    public void setName(String value) {
        name = value;
    }

    public void setEyeColor(String value) {
        eyeColor = value;
    }

    public void setSound(String value) {
        sound = value;
    }

    public int getAge() {
        return age;
    }


    public void setAge(int value){

        if(value > 0){
            age = value;
        }else {
            age = 0;
        }
    }


    public void speak(){

        JOptionPane.showMessageDialog(null,this.getSound());
    }

    public void AbstractAnimal(){

        setName("姓名");
        setEyeColor("眼睛的颜色");
        setAge(0);
    }


    public abstract  void speed();


}
